<?php
class YWebUser extends CWebUser
{
	public function onBeforeLogin($event)
	{
		$this->raiseEvent('onBeforeLogin', $event);
	}

	public function onAfterLogin($event)
	{
		$this->raiseEvent('onAfterLogin', $event);
	}

	public function onAfterLogout($event)
	{
		$this->raiseEvent('onAfterLogout', $event);
	}

	protected function afterLogin($fromCookie)
	{
		parent::afterLogin($fromCookie);
		if($this->hasEventHandler('onAfterLogin')){
			$event = new CEvent($this, array('fromCookie'=>$fromCookie));
			$this->onAfterLogin($event);
		}
	}

	protected function afterLogout()
	{
		parent::afterLogout();
		if($this->hasEventHandler('onAfterLogout')){
			$event=new CEvent($this);
			$this->onAfterLogout($event);
		}
	}
}
